//
//  SampleReelsCell.m
//  CBDWallpapar
//
//  Created by AD ` J on 2019/7/11.
//  Copyright © 2019年 CBD工作室. All rights reserved.
//

#import "CBDSampleReelsCell.h"

#import "NewPagedFlowView.h"
#import "PGIndexBannerSubiew.h"

@interface CBDSampleReelsCell ()

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *subTitleLabel;
@property (weak, nonatomic) IBOutlet UILabel *numberLabel;
@property (weak, nonatomic) IBOutlet UIImageView *coverImageView;

@end

@implementation CBDSampleReelsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.titleLabel.textColor = COLOR_NULL_1;
    self.subTitleLabel.textColor = COLOR_NULL_3;
    

    self.coverImageView.layer.cornerRadius = 5;;
    self.coverImageView.layer.masksToBounds = true;
    
    self.numberLabel.layer.cornerRadius = 2;
    self.numberLabel.layer.masksToBounds = true;
    [self reloadThemeColor];;
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadThemeColor) name:@"change_theme_color" object:nil];
}

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

- (void)setModel:(CBDRecommendModel *)model {
    _model = model;

    [self.coverImageView setImageURL:[NSURL URLWithString:model.cover_image_default]];
    self.titleLabel.text = model.name;
    self.subTitleLabel.text = model.author;
    self.numberLabel.text = [NSString stringWithFormat:@"%ld",model.view_count];
    

}

- (void)reloadThemeColor {
    self.numberLabel.backgroundColor = [[APPUtils getThemeColor] colorWithAlphaComponent:0.48];
    
//    [self.pageFlowView reloadData];
}


@end
